package package06章_面向对象编程_基础._08constructor.exer2;/**
 * ClassName: TriAngle
 * Package: package06章_面向对象编程_基础._08constructor.exer2
 * Description:
 *
 * @Author lys
 * @Create 2024/2/17 10:16
 * @Version 1.0
 */

/**
 * @author lys
 * @version 1.0
 * @description: TODO
 * @date 2024/2/17 10:16
 */
public class TriAngle {
    //属性
    private double base;//底边长
    private double height;//高

    public double getBase() {
        return base;
    }

    public void setBase(double base) {
        this.base = base;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public TriAngle() {

    }

    public TriAngle(double b, double h) {
        base = b;
        height = h;
    }
    //...

    //求面积的方法
    public double findArea() {
        return base * height / 2;
    }
}
